<template>
  <div>
      <h1>父组件---------{{msg}}</h1>
      <son :content="'I am from parent'" @showMsg="showMsg" v-bind="$attrs"></son>
  </div>
</template>

<script>
import son from './Son'
export default {
  data () {
    return {
      msg: '父组件中的数据'
    }
  },
  methods: {
    showMsg(val){
      this.msg = val
    }
  },
  components:{
      son
  },
  mounted() {
    console.log(this.$children[0].msg)
  },
}
</script>

<style scoped>

</style>
